Copyright ã1992 by Scott Hess.  All Rights Reserved.

Filename Pasting

The Pasteboard can contain a special type of data that specifies a filename or list of filenames.  This data may be generated in many ways, including use of the Stuart/Copy Filename Services menu entry.  Stuart provides some special handling of the filename data, but filename pasting is most useful in the context of file drag&drop (see Drag&Drop).

There are three types of filename pasting, depending on how the arguments are treated and what, if anything, is pasted with them.  Stuart can paste all of the filenames directly, Stuart can paste a `cd' command using a directory derived from the filenames, or Stuart can paste a `pushd' command using a directory derived from the filenames.

In the first case, the filenames themselves are separated by space characters.  For the pasting of either of the two commands, the filenames are processed to determine the directory to use as an argument.  If there is a multiple selection in the Pasteboard, then the directory of the first file in the selection is used (in most cases, this is the same directory all of files in the selection reside in).  If there is a single file selected and it is not a directory, the directory the file is in is used.  If there is a single file selected and it is a directory, that directory is used directly.

In the case of the two command pastes, the PrependControl-u preference can cause a Control-u to be output before the command itself.  In most shells, Control-u causes the current line to be erased.  The CshQuoting preference can cause csh-style quoting characters to be applied to the pasted data.  Lastly, the AppendNewline preference can cause a newline character to be sent after the data is pasted.